package com.wanmait.wanmarecruit.manageController;

import com.github.pagehelper.PageInfo;
import com.wanmait.wanmarecruit.annotation.ManageLogAnnotation;
import com.wanmait.wanmarecruit.entity.Recruiter;
import com.wanmait.wanmarecruit.service.RecruiterService;
import com.wanmait.wanmarecruit.util.AjaxResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/manage")
public class ManageRecruiterController {

    @Resource
    private RecruiterService recruiterService;

    //查出所有的招聘者（张佳炜）
    @RequestMapping("getAllHrMessage")
    public AjaxResult getAllHrMessage(Integer pageNum, String keyword, Integer positionTypeId)
    {
        if (pageNum==null)
        {
            pageNum=1;
        }
        Integer pageSize = 5;

        return AjaxResult.success(recruiterService.getAllHrMessageList(pageNum,pageSize,keyword,positionTypeId));
    }

    //封禁招聘者（张佳炜）
    @RequestMapping("updateRecruiterEnableById")
    public AjaxResult updateRecuuiterEnableById(Integer recruiterId)
    {
        recruiterService.updateHrEnableById(recruiterId);
        return AjaxResult.success("您已成功封禁该招聘者!");
    }
}
